<?php
session_start(); 
$user=$_POST["username"];
$pass=$_POST["password"];
if($user=='admin' && $pass=='admin')
{
	header ('Location: ../BlackAdmin/album.php');
	return;
}

        $conn = mysql_connect("localhost", "root","123456") or die("Ket noi den MySQL that bai");
        mysql_select_db("mp3", $conn);
        $sql = "select * from user where username='".$user."' and pass='".$pass."'";
        $q = mysql_query($sql);
        $rows = mysql_num_rows($q);
		
        if(!$rows == 0 )
        {
       	    $_SESSION["login"]=$user;
           header("Location:../mp3/home.php");	
        }
        else
        {
            echo "Dang Nhap That Bai";
?>
                <a href="../form/form.php" ><input type="button" value="Bạn đã đăng nhập sai vui lòng đăng nhập lại" /></a>
            <?php  
        }
?>
